<template>
    <div>
     <input type="text" v-model="year">
     <button @click="change()">判断是否是闰年</button>
     <p>{{ year }}年是{{ years }}</p>
    </div>
  </template>
  
  <script>
  export default {
     data(){
        return{
           year: '',
           years: ''
        }
     },
     methods:{
        change(){
           if((this.year % 4 == 0 &&this.year % 100 !== 0 ) || 
           this.year % 400 === 0  ){
              this.years = '闰'
           }else{
              this.years = '平'
           }
        }
     }
  }
  </script>
  
  <style>
  
  </style>